package kr.hkit.powerjava.mission;

public class Eworld {
	private int t;		//자유이용권 1, 입장권 0
	private int age;	//나이
	private int time;	//시간
	
	public Eworld(int t, int age, int time) {
		this.t = t;
		this.age = age;
		this.time = time;
	}
	public void setData(int t, int age, int time) {
		this.t = t;
		this.age = age;
		this.time = time;
	}
	public int getPrice(){
		int price = 0;
		if (this.t == 1){		//자유이용권
			if(time > 16){		//야간
				if(age < 3){						//영유아
					price = 0;
				}else if(age < 13 || age > 64){		//소인
					price = 21000;
				}else{								//대인
					price = 29000;
				}
			}else{				//주간
				if(age < 3){						//영유아
					price = 0;
				}else if(age < 13 || age > 64){		//소인
					price = 25000;
				}else{								//대인
					price = 34000;
				}
			}
		}else{					//입장권
			if(time > 16){		//야간
				if(age < 3){						//영유아
					price = 0;
				}else if(age < 13 || age > 64){		//소인
					price = 17000;
				}else{								//대인
					price = 23000;
				}
			}else{				//주간
				if(age < 3){						//영유아
					price = 0;
				}else if(age < 13 || age > 64){		//소인
					price = 20000;
				}else{								//대인
					price = 27000;
				}
			}
		}
		return price;
	}

	
	@Override
	public String toString() {
		return "Eworld [t=" + t + ", age=" + age + ", time=" + time
				+ ", getPrice()=" + getPrice() + "]";
	}

	
}
